export const map2options = <K extends string | number, V = any>(
	map: Record<any, V>,
) => {
	const data: { label: V; value: any }[] = [];
	Object.keys(map).forEach((item) => {
		data.push({
			label: map[item as K],
			value: item as K,
		});
	});
	return data;
};

//==============================
/**
 * 企业监管分类
 */
export const SUPERVISE_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "一般监督",
	2: "终点关注",
	3: "特别监管",
});
export const SUPERVISE_TYPE_OPTIONS = map2options(SUPERVISE_TYPE_MAP);
//==============================
/**
 * 企业所属行业
 */
export const INDUSTRY_MAP = Object.freeze<Record<any, string>>({
	1: "生产制造业",
	2: "储存与批发零售",
	3: "运输业",
	4: "使用与处置",
});
export const INDUSTRY_OPTIONS = map2options(INDUSTRY_MAP);
//==============================
/**
 * 企业诚信等级
 */
export const INTEGRITY_LEVEL_MAP = Object.freeze<Record<any, string>>({
	1: "优",
	2: "良",
	3: "中等",
	4: "差",
});
export const INTEGRITY_LEVEL_OPTIONS = map2options(INTEGRITY_LEVEL_MAP);
//==============================
/**
 * 企业经济类型
 */
export const ECONOMIC_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "私营经济",
	2: "国有经济",
	3: "股份制",
});
export const ECONOMIC_TYPE_OPTIONS = map2options(ECONOMIC_TYPE_MAP);
//==============================
/**
 * 企业员工在职状态
 */
export const DUTY_STATUS_MAP = Object.freeze<Record<any, string>>({
	0: "离职",
	1: "在职",
});
export const DUTY_STATUS_OPTIONS = map2options(DUTY_STATUS_MAP);
//==============================
/**
 * 工种
 */
export const WORKER_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "特种作业",
	2: "安全管理人员",
	3: "危险化学品作业人员",
	4: "剧毒化学品作业人员",
});
export const WORKER_TYPE_OPTIONS = map2options(WORKER_TYPE_MAP);
//==============================
/**
 * 设备运行状态
 */
export const DEVICE_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "正常",
	2: "停用",
	3: "检修",
});
export const DEVICE_STATUS_OPTIONS = map2options(DEVICE_STATUS_MAP);
//==============================
/**
 * 设备有效性
 */
export const EQP_VALIDITY_MAP = Object.freeze<Record<any, string>>({
	0: "无效",
	1: "有效",
});
export const EQP_VALIDITY_OPTIONS = map2options(EQP_VALIDITY_MAP);
//==============================
/**
 * 事故类型
 */
export const RESCUE_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "泄漏",
	2: "爆炸",
	3: "火灾",
	4: "其他类型",
});
export const RESCUE_TYPE_OPTIONS = map2options(RESCUE_TYPE_MAP);
//==============================
/**
 * 风险管控:风险状态
 */
export const DANGER_DESC_MAP = Object.freeze<Record<any, string>>({
	0: "已解除",
	1: "管控中",
});
export const DANGER_DESC_OPTIONS = map2options(DANGER_DESC_MAP);
//==============================
/**
 * 风险管控:是否有预警提醒
 */
export const HAS_WARING_MAP = Object.freeze<Record<any, string>>({
	0: "否",
	1: "是",
});
export const HAS_WARING_OPTIONS = map2options(HAS_WARING_MAP);
//==============================
/**
 *装置状态
 */
export const EQP_CHECK_STATUS_MAP = Object.freeze<Record<any, string>>({
	0: "冲突预警",
	1: "正常",
});
export const EQP_CHECK_STATUS_OPTIONS = map2options(EQP_CHECK_STATUS_MAP);
//==============================
/**
 *装置类型
 */
export const EQP_CHECK_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "装置开停车",
	2: "大检修",
});
export const EQP_CHECK_TYPE_OPTIONS = map2options(EQP_CHECK_TYPE_MAP);
//==============================
/**
 *特殊作业报备:作业状态
 */
export const TASK_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "待施工",
	2: "施工中",
	3: "已验收",
});
export const TASK_STATUS_OPTIONS = map2options(TASK_STATUS_MAP);
//==============================
/**
 *特殊作业报备:作业类型
 */
export const TASK_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "动火作业",
	2: "受限空间作业",
	3: "盲板抽堵作业",
	4: "高处作业",
	5: "吊装作业",
	6: "临时用电作业",
	7: "动图作业",
	8: "断路作业",
});
export const TASK_TYPE_OPTIONS = map2options(TASK_TYPE_MAP);
//==============================
/**
 *第三方单位:资质等级
 */
export const THIRD_LEVEL_MAP = Object.freeze<Record<any, string>>({
	0: "特级",
	1: "一级",
	2: "二级",
	3: "三级",
});
export const THIRD_LEVEL_OPTIONS = map2options(THIRD_LEVEL_MAP);
//==============================
/**
 *第三方单位:审核状态
 */
export const THIRD_AUDIT_STATE_MAP = Object.freeze<Record<any, string>>({
	1: "待审核",
	2: "审核通过",
	3: "审核驳回",
});
export const THIRD_AUDIT_STATE_OPTIONS = map2options(THIRD_AUDIT_STATE_MAP);
//==============================
/**
 *考试题库:试题类别
 */
export const EXAMINE_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "单选",
	2: "多选",
	3: "判断",
});
export const EXAMINE_TYPE_OPTIONS = map2options(EXAMINE_TYPE_MAP);
//==============================
/**
 *证书状态
 */
export const CERTIF_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "即将过期",
	2: "已过期",
	3: "已发放",
});
export const CERTIF_STATUS_OPTIONS = map2options(CERTIF_STATUS_MAP);
//==============================
/**
 *报告类型
 */
export const REPORT_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "定性评估报告",
	2: "定量评估报告",
	3: "综合评估报告",
	4: "定期评估报告",
	5: "专项评估报告",
});
export const REPORT_TYPE_OPTIONS = map2options(REPORT_TYPE_MAP);
//==============================
/**
 *危险源等级
 */
export const DANGER_LEVEL_MAP = Object.freeze<Record<any, string>>({
	1: "一级",
	2: "二级",
	3: "三级",
	4: "四级",
	0: "非重大",
});
export const DANGER_LEVEL_OPTIONS = map2options(DANGER_LEVEL_MAP);
//==============================
/**
 *信用类型
 */
export const CREDIT_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "行政许可",
	2: "行政处罚",
});
export const CREDIT_TYPE_OPTIONS = map2options(CREDIT_TYPE_MAP);
//==============================
/**
 *文章类型
 */
export const ARTICLE_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "宣传栏",
	0: "考试培训",
});
export const ARTICLE_TYPE_OPTIONS = map2options(ARTICLE_TYPE_MAP);
//==============================
/**
 *检查计划类型
 */
export const CHECK_PLAN_MAP = Object.freeze<Record<any, string>>({
	1: "日常检查",
	2: "专项检查",
	3: "重要节假日活动",
	4: "其他",
});
export const CHECK_PLAN_OPTIONS = map2options(CHECK_PLAN_MAP);
//==============================
/**
 *隐患级别
 */
export const HAZARD_LEVEL_MAP = Object.freeze<Record<any, string>>({
	1: "一般隐患",
	2: "重大隐患",
});
export const HAZARD_LEVEL_OPTIONS = map2options(HAZARD_LEVEL_MAP);
//==============================
/**
 *督办整改状态
 */
export const SUPERVISION_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "待复查",
	2: "待整改",
	3: "逾期未整改",
	4: "已完成",
	5: "延期整改中",
});
export const SUPERVISION_STATUS_OPTIONS = map2options(SUPERVISION_STATUS_MAP);
//==============================
/**
 *复查结果状态
 */
export const CHECK_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "复查通过",
	0: "复查驳回",
});
export const CHECK_STATUS_OPTIONS = map2options(CHECK_STATUS_MAP);

/* 新增========================================================================================================== */

//==============================
/**
 *企业端预约记录-申请类型
 */
export const RECORD_TYPE_MAP = Object.freeze<Record<any, string>>({
	1: "危化品车辆",
	2: "车辆",
	3: "员工",
	4: "访客",
});
export const RECORD_TYPE_OPTIONS = map2options(RECORD_TYPE_MAP);

//==============================
/**
 *企业端预约记录-申请状态
 */
export const RECORD_STATUS_MAP = Object.freeze<Record<any, string>>({
	1: "待审核",
	2: "已撤回",
	3: "已驳回",
	4: "通过",
});
export const RECORD_STATUS_OPTIONS = map2options(RECORD_STATUS_MAP);
